<template>
  <div class="staffHomeActiv.vue">
    <!-- <contertList :list="ditActiv"></contertList> -->
    <div v-if="!$store.state.isbusNewsDitle">
      <div
        class="notice_list"
        v-for="item in sheyingList"
        :key="item.id"
      >
        <div class="notice_box">
          <i class="yuan"></i>
          <p
            class="notice_name pointer"
            @click="handDitle(item)"
          >{{item.title}}</p>
          <div
            v-show="item.sta==1"
            class="my_new"
          >[ 新 ]</div>
        </div>

        <div>
          [ {{item.createdTime}} ]
        </div>
      </div>
      <div
        class="page_box"
        style="margin-top: 70px"
      >
        <el-pagination
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :page-sizes="[5,10,15]"
          :page-size="pageBid3.limit"
          layout="total, prev, pager, next, jumper"
          :total="pageBid3.totalCount"
        >
        </el-pagination>
      </div>
    </div>
    <transition name="fade">
      <div
        v-if="$store.state.isbusNewsDitle"
        class="busDitle_dog"
      >
        <mydetails
          :sonList="ditActiv"
          :dateils="dateils"
        ></mydetails>
      </div>
    </transition>
  </div>
</template>

<script>
import contertList from "@/components/contertList";
export default {
  name: "staffHomeActiv.vue",
  watch: {
    ditActiv(newList, oList) {}
  },
  props: {
    ditActiv: {
      type: Array
    },
    sonid: {
      type: Number
    }
  },
  components: {
    contertList
  },
  data() {
    return {
      pageBid3: {
        start: 1,
        limit: 10,
        totalCount: 0,
        tatalpage: 0
      },
      list: [],
      dateils: {},
      sheyingList: []
    };
  },
  mounted() {
    console.log(this.sonid, "idddd");
    this.$api.getList({ sortId: this.sonid, page: 1, limit: 10 }).then(res => {
      console.log(res.data.data, "职工活动");
      this.sheyingList = res.data.data;
      this.pageBid3.totalCount = res.data.count;
      this.sheyingList.forEach(item => {
        item.img = item.img.replace(/\\/g, "/");
        item.img = this.$store.state.baseUrl + item.img;
      });
    });
  },
  methods: {
    init(page) {
      this.$api
        .getList({ sortId: this.sonid, page: page, limit: 10 })
        .then(res => {
          this.sheyingList = res.data.data;
          this.sheyingList.forEach(item => {
            item.img = item.img.replace(/\\/g, "/");
            item.img = this.$store.state.baseUrl + item.img;
          });
        });
    },
    handDitle(item) {
      this.dateils = item;
      this.$store.commit("handBus", true);
    },
    handleSizeChange() {},
    handleCurrentChange(val) {
      this.init(val);
    }
  }
};
</script>

<style lang='scss' scoped>
.notice_list {
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  .notice_box {
    display: flex;
    align-items: center;
    color: #333;
    font-size: 16px;
    .my_new {
      color: #e6142f;
      margin-left: 36px;
    }
    .notice_name {
      margin-left: 20px;
      max-width: 455px;
    }
  }
}
</style>
